import request from "../utils/request";

export interface IPassword {
    id: number,
    title: string,
    username: string,
    email: string,
    phone: string,
    other: string,
    category: number
}

export class Password {
    static getCategory = () => request({
        url: "/password/getCategory",
        method: "GET",
    })
    static updateCategory = (data: { id: number, categoryName: string }) => request({
        url: "/password/updateCategory",
        method: "POST",
        data
    })
    static deleteCategory = (id: number) => request({
        url: "/password/deleteCategory",
        method: "GET",
        params: {id}
    })
    static getPasswordData = (uid:string) => request({
        url: "/password/getPasswordData",
        method: "GET",
        params:{uid}

    })

    static addPassword = (data: IPassword) => request({
        url: "/password/addPassword",
        method: "POST",
        data
    })

    static deletePassword = (id: number) => request({
        url: "/password/deletePassword",
        method: "GET",
        params: {id}
    })
}